package fmanganiello.tests.javatests.depinj.billing;

public class Receipt {
	private double amount;
	private String message;
	
	private Receipt(double amount, String message) {
		this.amount = amount;
		this.message = message;
	}

	private Receipt(double amount) {
		this(amount, "OK");
	}
	
	private Receipt(String message) {
		this(-1, message);
	}
	
	public static Receipt forSuccessfulCharge(double amount) {
		return new Receipt(amount);
	}
	
	public static Receipt forDeclinedCharge(String message) {
		return new Receipt(message);
	}

	public double getAmount() {
		return amount;
	}

	public String getMessage() {
		return message;
	}
	
	public boolean hasSuccessfulCharge() {
		return amount >= 0;
	}
}
